<template>
	<view class="report-container">
		<view class="title" id='t'>
			<!-- <image src="/static/images/title.png" class="img" mode="scaleToFill"></image> -->
			<h1>个人司法诉讼</h1>
			<h4>信鸟查</h4>
			<h4>综合匹配度：{{ppd()}}</h4>
		</view>
		<view class="report-section section10" style="height: 186px;">
			<view class="title">司法诉讼汇总</view>
			<view class="content">
				<cc-table :data="data01" />
				<cc-table :data="data02" />
				<!-- <cc-table :data="data03" title="案件统计" />
				<cc-table :data="data04" />
				<cc-table :data="data05" />
				<cc-table :data="data06" />
				<cc-table :data="data07" />
				<cc-table :data="data08" /> -->
			</view>
		</view>
		<!-- 	<view class="report-section section04" style="height: 1000rpx;">
			<view class="title">各案件关系树</view>
			<view class="content">
				<view id="ajcls" style="width: 100%;height: 800rpx;"></view>
				<cc-advice content="减少申请机构频率，保持良好的借贷习惯。"></cc-advice>
			</view>
		</view> -->
		<view class="report-section section12">
			<view class="title">法院公告{{ detail1.civil.cases ? '' : '（暂无）' }}</view>
			<view class="content">
				<view class="content-item">
					<!-- {{detail1.civil}} -->
					<view v-if="detail1.civil.cases" v-for="(item, index) in detail1.civil.cases" class="bottom">
						<view class="item">
							<view class="left">案号</view>
							<view class="right">{{ item.c_ah }}</view>
						</view>
						<view class="item">
							<view class="left">案件类型</view>
							<view class="right">{{ item.n_ajlx }}</view>
						</view>
						<view class="item">
							<view class="left">法院</view>
							<view class="right">{{ item.n_jbfy }}</view>
						</view>
						<view class="item">
							<view class="left">诉讼身份</view>
							<view class="right">{{ item.n_ssdw }}</view>
						</view>
						<view class="item">
							<view class="left">立案时间</view>
							<view class="right">{{ item.d_larq  }}</view>
						</view>
						<view class="item">
							<view class="left">结案时间</view>
							<view class="right">{{ item.d_jarq}}</view>
						</view>
						<view class="item">
							<view class="left">结案方式</view>
							<view class="right">{{ item.c_ah }}</view>
						</view>
						<view class="item">
							<view class="left">执行标的金额</view>
							<view class="right">{{ item.n_sqzxbdje}}</view>
						</view>
						<view class="item">
							<view class="left">判决结果</view>
							<view class="right">{{ item.n_jafs }}</view>
						</view>
						<view class="page">
							第{{index+1}}条 / 共{{detail1.civil.cases.length}}条
						</view>
					</view>
				</view>
			</view>
		</view>

		<view class="report-section section12">
			<view class="title">涉案信息{{ detail1.criminal.cases? '' : '（暂无）' }}</view>
			<view class="content">
				<view class="content-item">
					<view v-if="detail1.criminal.cases" v-for="(item, index) in detail1.criminal.cases" class="bottom">
						<view class="item">
							<view class="left">案号</view>
							<view class="right">{{ item.c_ah }}</view>
						</view>
						<view class="item">
							<view class="left">案件类型</view>
							<view class="right">{{ item.n_ajlx }}</view>
						</view>
						<view class="item">
							<view class="left">法院</view>
							<view class="right">{{ item.n_jbfy }}</view>
						</view>
						<view class="item">
							<view class="left">诉讼身份</view>
							<view class="right">{{ item.n_ssdw }}</view>
						</view>
						<view class="item">
							<view class="left">立案时间</view>
							<view class="right">{{ item.d_larq  }}</view>
						</view>
						<view class="item">
							<view class="left">结案时间</view>
							<view class="right">{{ item.d_jarq}}</view>
						</view>
						<view class="item">
							<view class="left">结案方式</view>
							<view class="right">{{ item.c_ah }}</view>
						</view>
						<view class="item">
							<view class="left">执行标的金额</view>
							<view class="right">{{ item.n_sqzxbdje}}</view>
						</view>
						<view class="item">
							<view class="left">判决结果</view>
							<view class="right">{{ item.n_jafs }}</view>
						</view>
						<view class="page">
							第{{index+1}}条 / 共{{detail1.criminal.cases.length}}执行
						</view>
					</view>
				</view>
			</view>
		</view>

		<view class="report-section section12">
			<view class="title">案件流程{{ detail1.administrative.cases? '' : '（暂无）' }}</view>
			<view class="content">
				<view class="content-item">
					<view v-if="'cases' in detail1.administrative" v-for="(item, index) in detail1.administrative.cases"
						class="bottom">
						<view class="item">
							<view class="left">案号</view>
							<view class="right">{{ item.c_ah }}</view>
						</view>
						<view class="item">
							<view class="left">案件类型</view>
							<view class="right">{{ item.n_ajlx }}</view>
						</view>
						<view class="item">
							<view class="left">法院</view>
							<view class="right">{{ item.n_jbfy }}</view>
						</view>
						<view class="item">
							<view class="left">诉讼身份</view>
							<view class="right">{{ item.n_ssdw }}</view>
						</view>
						<view class="item">
							<view class="left">立案时间</view>
							<view class="right">{{ item.d_larq  }}</view>
						</view>
						<view class="item">
							<view class="left">结案时间</view>
							<view class="right">{{ item.d_jarq}}</view>
						</view>
						<view class="item">
							<view class="left">结案方式</view>
							<view class="right">{{ item.c_ah }}</view>
						</view>
						<view class="item">
							<view class="left">执行标的金额</view>
							<view class="right">{{ item.n_sqzxbdje}}</view>
						</view>
						<view class="item">
							<view class="left">判决结果</view>
							<view class="right">{{ item.n_jafs }}</view>
						</view>
						<view class="page">
							第{{index+1}}条 / 共{{detail1.administrative.cases.length}}执行
						</view>
					</view>
				</view>
			</view>
		</view>

		<view class="report-section section12">
			<view class="title">执行公告{{ detail1.implement.cases  ? '' : '（暂无）' }}</view>
			<view class="content">
				<view class="content-item">
					<view v-if="'cases' in detail1.implement" v-for="(item, index) in detail1.implement.cases"
						class="bottom">
						<view class="item">
							<view class="left">案号</view>
							<view class="right">{{ item.c_ah }}</view>
						</view>
						<view class="item">
							<view class="left">案件类型</view>
							<view class="right">{{ item.n_ajlx }}</view>
						</view>
						<view class="item">
							<view class="left">法院</view>
							<view class="right">{{ item.n_jbfy }}</view>
						</view>
						<view class="item">
							<view class="left">诉讼身份</view>
							<view class="right">{{ item.n_ssdw }}</view>
						</view>
						<view class="item">
							<view class="left">立案时间</view>
							<view class="right">{{ item.d_larq  }}</view>
						</view>
						<view class="item">
							<view class="left">结案时间</view>
							<view class="right">{{ item.d_jarq}}</view>
						</view>
						<view class="item">
							<view class="left">结案方式</view>
							<view class="right">{{ item.c_ah }}</view>
						</view>
						<view class="item">
							<view class="left">执行标的金额</view>
							<view class="right">{{ item.n_sqzxbdje}}</view>
						</view>
						<view class="item">
							<view class="left">判决结果</view>
							<view class="right">{{ item.n_jafs }}</view>
						</view>
						<view class="page">
							第{{index+1}}条 / 共{{detail1.implement.cases.length}}执行
						</view>
					</view>
				</view>
			</view>
		</view>

		<view class="report-section section12">
			<view class="title">限制高消费{{ detail1.bankrupt.cases ? '' : '（暂无）' }}</view>
			<view class="content">
				<view class="content-item">
					<view v-if="'cases' in detail1.bankrupt" v-for="(item, index) in detail1.bankrupt .cases"
						class="bottom">
						<view class="item">
							<view class="left">案号</view>
							<view class="right">{{ item.c_ah }}</view>
						</view>
						<view class="item">
							<view class="left">案件类型</view>
							<view class="right">{{ item.n_ajlx }}</view>
						</view>
						<view class="item">
							<view class="left">法院</view>
							<view class="right">{{ item.n_jbfy }}</view>
						</view>
						<view class="item">
							<view class="left">诉讼身份</view>
							<view class="right">{{ item.n_ssdw }}</view>
						</view>
						<view class="item">
							<view class="left">立案时间</view>
							<view class="right">{{ item.d_larq  }}</view>
							<view class="right">{{ item.d_larq  }}</view>

						</view>
						<view class="item">
							<view class="left">结案时间</view>
							<view class="right">{{ item.d_jarq}}</view>
						</view>
						<view class="item">
							<view class="left">结案方式</view>
							<view class="right">{{ item.c_ah }}</view>
						</view>
						<view class="item">
							<view class="left">执行标的金额</view>
							<view class="right">{{ item.n_sqzxbdje}}</view>
						</view>
						<view class="item">
							<view class="left">判决结果</view>
							<view class="right">{{ item.n_jafs }}</view>
						</view>
						<view class="page">
							第{{index+1}}条 / 共{{detail1.bankrupt.cases.length}}执行
						</view>
					</view>
				</view>
			</view>
		</view>

		<view class="report-section section12">
			<view class="title">曝光台{{ detail1.preservation.cases ? '' : '（暂无）' }}</view>
			<view class="content">
				<view class="content-item">
					<view v-if="'cases' in detail1.preservation" v-for="(item, index) in detail1.preservation.cases"
						class="bottom">
						<view class="item">
							<view class="left">案号</view>
							<view class="right">{{ item.c_ah }}</view>
						</view>
						<view class="item">
							<view class="left">案件类型</view>
							<view class="right">{{ item.n_ajlx }}</view>
						</view>
						<view class="item">
							<view class="left">法院</view>
							<view class="right">{{ item.n_jbfy }}</view>
						</view>
						<view class="item">
							<view class="left">诉讼身份</view>
							<view class="right">{{ item.n_ssdw }}</view>
						</view>
						<view class="item">
							<view class="left">立案时间</view>
							<view class="right">{{ item.d_larq  }}</view>
						</view>
						<view class="item">
							<view class="left">结案时间</view>
							<view class="right">{{ item.d_jarq}}</view>
						</view>
						<view class="item">
							<view class="left">结案方式</view>
							<view class="right">{{ item.c_ah }}</view>
						</view>
						<view class="item">
							<view class="left">执行标的金额</view>
							<view class="right">{{ item.n_sqzxbdje}}</view>
						</view>
						<view class="item">
							<view class="left">判决结果</view>
							<view class="right">{{ item.n_jafs }}</view>
						</view>
						<view class="page">
							第{{index+1}}条 / 共{{detail1.preservation.cases.length}}执行
						</view>
					</view>
				</view>
			</view>
		</view>
		<template v-if="orderNo">
			<liu-drag-button @clickBtn="FP()" :bottomPx="85">发票</liu-drag-button>
			<liu-drag-button @clickBtn="FX()">分享</liu-drag-button>
		</template>
	</view>
</template>
<script>
	import * as echarts from "echarts"
	import {
		data01,
		data02,
		data03,
		data04,
		data05,
		data06,
		data07,
		data08,
		// disposeCasesTree,
		disData,
		ppd
	} from '@/utils/jud.js'

	import {
		query
	} from '@/api/jinjian.js'

	import {
		judTemInfo
	} from '@/utils/temInfo.js'

	export default {
		data() {
			return {
				orderNo: undefined,
				data01,
				data02,
				// data03,
				// data04,
				// data05,
				// data06,
				// data07,
				// data08,
				detail1: {
					civil: {},
					criminal: {},
					administrative: {},
					implement: {},
					bankrupt: {},
					preservation: {}
				}
			}
		},
		onLoad(options) {
			this.$modal.loading('正在查询，请稍后...')
			if (options.orderNo) {
				this.orderNo = options.orderNo
				query({
					orderNo: this.orderNo,
					name: 5
				}).then(res => {
					if (res.code === 200) {
						let data = res.data
						let grss = JSON.parse(data.queryInfo).grss

						if (grss.retcode == '000000') {
							const retdata = grss.retdata
							if (retdata.detail && retdata.detail[0]) {
								var detail1 = retdata.detail[0]
								this.hanbleData(detail1)
							} else {
								this.$modal.msg(retdata.messge)
							}
						}
					} else {
						this.$modal.alert(res.msg)
					}
					this.$modal.closeLoading()
				})
			} else {
				this.hanbleData(judTemInfo)
				this.$modal.closeLoading()
			}
		},
		
		mounted() {
			// this.initEchart01()
		},
		
		methods: {
			ppd,
			hanbleData(detail1) {
				// this.initEchart01(detail1.cases_tree)
				// 处理数据，启动渲染
				this.detail1 = detail1
				disData(detail1)
			}
		}
		// initEchart01(cases_tree) {
		// 	var data = disposeCasesTree(cases_tree)
		// 	console.log('--data-', data)
		// 	var echart01 = echarts.init(document.getElementById("ajcls"));
		// 	const options = {
		// 		tooltip: {
		// 			trigger: 'item',
		// 			triggerOn: 'mousemove'
		// 		},
		// 		series: [{
		// 			type: 'tree',
		// 			data: [data],
		// 			left: '2%',
		// 			right: '2%',
		// 			top: '8%',
		// 			bottom: '20%',
		// 			symbol: 'emptyCircle',
		// 			orient: 'vertical',
		// 			expandAndCollapse: true,
		// 			label: {
		// 				position: 'top',
		// 				rotate: -90,
		// 				verticalAlign: 'middle',
		// 				align: 'right',
		// 				fontSize: 9
		// 			},
		// 			leaves: {
		// 				label: {
		// 					position: 'bottom',
		// 					rotate: -90,
		// 					verticalAlign: 'middle',
		// 					align: 'left'
		// 				}
		// 			},
		// 			animationDuration: 550,
		// 			animationDurationUpdate: 750
		// 		}]
		// 	}
		// 	echart01.setOption(options)
		// 	window.addEventListener("resize", () => {
		// 		echart01.resize()
		// 	})
		// }

	}
</script>
<style scoped lang="scss">
	@import "@/static/scss/poster.scss";
	#t h1, h4 {
		text-align: center;
		margin-top: 10px;
	}
</style>